package org.kwin.test.servlet;

import org.kwin.tomcat.annotation.WebServlet;
import org.kwin.tomcat.servlet.http.HttpServlet;
import org.kwin.tomcat.servlet.http.HttpServletRequest;
import org.kwin.tomcat.servlet.http.HttpServletResponse;

/**
 * @author : wangkai
 * @version V1.0
 * @Package org.kwin.test.servlet
 * @Description:
 * @date 2021年10月12日 10:52
 **/
@WebServlet(urlPatterns = {"/a/*", "/b/*"})
public class DispatcherServlet extends HttpServlet {
    @Override
    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws Exception {
        doPost(req, resp);
    }
    
    @Override
    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws Exception {
        System.out.println("params :" + req.getParameters().toString());
        resp.setContentType("application/json");
        resp.getWriter().write("{\"success\":true,\"code\":\"0\",\"msg\":null,\"data\":\"heheheh\"}");
    }
}
